package com.candy.service.impl;

import com.candy.dao.IAccountDao;
import com.candy.dao.impl.AccountDaoImpl;
import com.candy.service.IAccountService;

import java.util.Date;

/**
 * 业务逻辑处理层
 */
public class AccountServiceImpl implements IAccountService {
    private IAccountDao accountDao=new AccountDaoImpl();
    private String name;
    private Integer age;
    private Date birthday;

    public AccountServiceImpl() {
    }

    public AccountServiceImpl(String name, Integer age, Date birthday) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public AccountServiceImpl(IAccountDao accountDao) {
        this.accountDao = accountDao;
    }

    @Override
    public void saveAccount(){
        System.out.println("name:"+name+"\tage:"+age+"\tbirthday:"+birthday);

    }

    public void startMethod(){
        System.out.println("对象初始化调用....");
    }
    public  void endMethod(){
        System.out.println("对象销毁调用.....");
    }


}
